<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'menu.label', default: 'Menu')}"/>

    <title>弹性域模块：${this.flexField?.category?.name}</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>弹性域模块：${this.flexField?.category?.name}</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link action="index" controller="flexFieldCategory">弹性域模块</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">弹性域模块：${this.flexField?.category?.name}</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">

            <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>弹性域详情：${this.flexField?.category?.name}</h5>

                    <div class="card-header-right">
                        <sec:ifNotGranted roles="ROLE_COO">
                            <g:link action="edit" resource="${this.flexField}" data-toggle="tooltip"
                                    data-placement="top"
                                    title="" data-original-title="编辑">
                                <i class="icofont icofont-edit"></i>
                            </g:link>
                        </sec:ifNotGranted>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>

                </div>

                <div class="card-block">
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">名称</label>

                        <div class="col-md-3">${this.flexField?.name}</div>
                        <label class="col-md-2 col-form-label">描述</label>

                        <div class="col-md-3">${this.flexField?.description}</div>
                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">数据类型</label>

                        <div class="col-md-3">${this.flexField?.dataType}</div>
                        <label class="col-md-2 col-form-label">默认值</label>

                        <div class="col-md-3">${this.flexField?.defaultValue}</div>
                    </div>

                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">次序</label>

                        <div class="col-md-3">${this.flexField?.displayOrder}</div>
                        <label class="col-md-2 col-form-label">约束</label>

                        <div class="col-md-3">${this.flexField?.valueConstraints}</div>
                    </div>

                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">有效性</label>

                        <div class="col-md-8">${this.flexField?.active}</div>
                    </div>

                </div>
            </div>

        </div>

        <div class="card">
            <div class="card-header">
                <h5>弹性域值</h5>

                <div class="card-header-right">
                    <sec:ifNotGranted roles="ROLE_COO">
                        <g:link controller="flexFieldValue" action="create"
                                params="[field: this.flexField?.id]"
                                data-toggle="tooltip"
                                data-placement="top" title=""
                                data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>
                    </sec:ifNotGranted>




                    <i class="icofont icofont-rounded-down"></i>
                </div>
            </div>

            <div class="card-block dt-responsive">

                <div class="table-responsive">
                    <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                        <div class="table-responsive">
                            <table class="table table-striped table-hover table-bordered">
                                <thead>
                                <tr>
                                    <g:sortableColumn property="value" title="值"/>
                                    <g:sortableColumn property="displayOrder" title="次序"/>
                                    <g:sortableColumn property="active" title="有效性"/>
                                    <g:sortableColumn property="active" class="text-center" width="15%" title="操作"/>
                                </tr>
                                </thead>
                                <tbody>
                                <g:each in="${this.flexField?.values}">
                                    <div class="col-md-4">
                                        <tr>
                                            <td><g:link action="show" controller="flexFieldValue" id="${it?.id}"
                                                        class="firstTd">${it?.value}</g:link></td>
                                            <td>${it?.displayOrder}</td>
                                            <td>${it?.active}</td>
                                            <td class="text-center">
                                                <g:link class="m-r-15 text-primary"
                                                        controller="flexFieldValue" action="edit"
                                                        id="${it?.id}">
                                                    <i class="icofont icofont-ui-edit"></i>
                                                </g:link>

                                                <g:form controller="flexFieldValue" action="delete" class="inline"
                                                        id="${it.id}" method="DELETE">
                                                    <button class="deleteBtn text-danger" type="button">
                                                        <i class="icofont icofont-trash"></i>
                                                    </button>
                                                </g:form>

                                            </td>
                                        </tr>
                                    </div>
                                </g:each>
                                </tbody>

                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <!-- Hover table card end -->
    </div>

    <!-- Page-body end -->

</div>
</div>

</body>

</html>


